A flash memory is a type of non-volatile memory that has a characteristic of retaining data after a power failure. Therefore, the flash memory is widely used as an external memory.
A storage manner of the flash memory is different from that of a conventional mechanical memory. For example, all or some data of a file is stored in a storage area of the flash memory. When a user re-saves the data, for example, the user modifies the data and directly saves modified data, the flash memory does not write the re-saved data into the original storage area but writes the re-saved data into a new storage area of the flash memory, and the data in the original storage area remains unchanged. In this case, it seems that the data has been overwritten by the data that is re-saved by the user, but actually, even if the user deletes the re-saved data, the data before the re-saving by the user still exists in the flash memory, and persons skilled in the art can still read, by using some technical means or tools, the data that still exists in the flash memory. Therefore, data leakage cannot be prevented.
To implement that data stored in a flash memory is securely erased, that is, to erase all data sections that are stored in the flash memory and are related to the data, including data before re-saving and data after re-saving, two manners are generally provided: one manner is erasing a system entry of the flash memory to achieve a purpose of data destruction; the other manner is performing full-disk erasing on the flash memory, that is, full-disk formatting. However, the two erasing manners have disadvantages. In the first manner, the flash memory cannot be used again; in the second manner, full-disk data loss may be caused, thereby affecting reading and writing of other data, except data that needs to be erased, stored in the flash memory.